﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using ValidationFramework.Configuration;
using ValidationFramework.Configuration.Xml;
using Rhino.Mocks;

namespace ValidationFramework.Tests.Configuration
{
	[TestFixture]
	public class InitializationExpressionTest
	{
		[Test]
		public void Should_Be_Constructed_As_Expected()
		{
			var expression = new InitializationExpression();
			Assert.AreEqual(0, expression.GetParserRepository().ParserCount);
			Assert.AreEqual(false, expression.LoadConfigurationFromAppConfig);
		}

		[Test]
		public void Should_Add_Parser_To_Repository()
		{
			var expression = new InitializationExpression();
			var stubParser = MockRepository.GenerateStub<ISpecificationXmlParser>();

			expression.RegisterReader(typeof(ISpecification), stubParser);

			Assert.AreEqual(1, expression.GetParserRepository().ParserCount);
		}

	}
}
